package com.liu.cloud.controller;

import com.liu.cloud.feign.RemoteStockFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author LIU
 * @version 1.0
 * @description: TODO
 * @date 2023/6/18 12:49
 */
@RestController
@RequestMapping("/order")
public class OrderController {

    /**
     * 注入feign接口调用
     */
    @Autowired
    RemoteStockFeignService stockFeignService;


    @RequestMapping("/add/{id}")
    public String add(@PathVariable("id")String id){
        System.out.println("下单成功");
        String msg = stockFeignService.add();

        return  String.format("hello world  id:[ %s ],msg: %s", id, msg);
    }


}
